﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>bindData</title>
    <script src="scripts/jquery-1.8.1.min.js" type="text/javascript"></script>
    <script src="scripts/bingo.js" type="text/javascript"></script>
    <script type="text/javascript">
        //定义action1
        var action1 = bingo.action(function ($view) {
            
            $view.user = {
                name: '张三',
                age:20
            };

            setTimeout(function () {
                //重新设置user
                $view.user = {
                    name: '李四',
                    age: 23
                };

                //刷新view
                $view.$update();

            }, 1000);

        });
    </script>
</head>
<body>
    <!--与action1连接, 形成一个新view-->
    <div bg-action="action1">
        姓名:{{user.name}}, 年龄:{{user.age}}
        <br />
        姓名(第一次):{{: user.name}}
    </div>
</body>
</html>
